{include file="public/header" /}
<body class="layui-layout-body">
<div id="LAY_app" class="layadmin-side-shrink">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <!-- 头部区域 -->
            <ul class="layui-nav layui-layout-left">
                <li class="layui-nav-item layadmin-flexible" lay-unselect>
                    <a href="javascript:;" class="flexible" layadmin-event="flexible" title="侧边伸缩">
                        <i class="layui-icon layui-icon-spread-left" id="LAY_app_flexible"></i>
                    </a>
                </li>

                <li class="layui-nav-item" lay-unselect>
                    <a href="javascript:;" layadmin-event="refresh" title="刷新">
                        <i class="layui-icon layui-icon-refresh-3"></i>
                    </a>
                </li>

            </ul>
            <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">

                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a href="javascript:;" layadmin-event="fullscreen">
                        <i class="screen layui-icon layui-icon-screen-full"></i>
                    </a>
                </li>

                <li class="layui-nav-item" lay-unselect>
                    <a href="javascript:;">
                        <cite>{$_admin.admin_name}</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a layadmin-event="changePwd">修改密码</a></dd>
                        <dd style="text-align: center;"><a layadmin-event="signOut">退出</a></dd>
                    </dl>
                </li>

                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a layadmin-event="clearCache" title="清除缓存">
                        <i class="layui-icon layui-icon-fonts-clear"></i>
                    </a>
                </li>
                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a href="javascript:;" layadmin-event="theme" title="配色方案">
                        <i class="layui-icon layui-icon-theme"></i>
                    </a>
                </li>
                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a id="drawerIframe" href="javascript:window.open('/');" title="前台"><i class="layui-icon layui-icon-website"></i></a>
                </li>
            </ul>
        </div>

        <!-- 侧边菜单 -->
        <div class="layui-side layui-side-menu white-theme">
            <div class="first-menu">
                <div class="first-logo">
                    <img src="{:cache('system')['web_site_logo']}">
                </div>
                <ul class="layui-nav layui-nav-tree layui-menu" id="LAY-system-side-menu"
                    lay-filter="layadmin-system-side-menu">
                    {foreach name="menus" item="vo" key="key"}
                    <li class="layui-menu-item-parent switch-menu {if $key == 0}layui-menu-item-checked2{/if}">
                        <div class="layui-menu-body-title faster-title">
                            <div>
                                <i class="layui-icon {$vo.css?$vo.css:'layui-icon-component'}"></i>
                            </div>
                            <p>{$vo.title}</p>
                        </div>
                        {if isset($vo.child)}
                        <div class="layui-panel layui-menu-body-panel eject-menu">
                            <ul class="layui-anim layui-anim-down">
                                {foreach name="$vo.child" item="son"}
                                <li lay-options="" lay-href="{$son.href}">
                                    <div class="layui-menu-body-title">{$son.title}</div>
                                </li>
                                {/foreach}
                            </ul>
                        </div>
                        <div class="child-menu-hide">
                            <div class="child-menu-title">
                                {$vo.title}
                            </div>
                            <ul class="layui-nav layui-nav-tree layui-menu  layui-anim layui-anim-downbit">
                                {foreach name="$vo.child" item="son"}
                                <li class="layui-menu-item-parent each-child" lay-href="{$son.href}"
                                    onclick="menuChecked($(this))">
                                    <div class="layui-menu-body-title faster-title"
                                         style="text-align: center;padding: initial">
                                        {$son.title}
                                    </div>
                                </li>
                                {/foreach}
                            </ul>
                        </div>
                        {/if}
                    </li>
                    {/foreach}
                    {foreach name="attachMenu" item="vo"}
                    <li class="layui-menu-item-parent switch-menu">
                        <div class="layui-menu-body-title faster-title">
                            <div>
                                <i class="layui-icon {$vo.css?$vo.css:'layui-icon-component'}"></i>
                            </div>
                            <p>{$vo.title}</p>
                        </div>
                        {if isset($vo.child)}
                        <div class="layui-panel layui-menu-body-panel eject-menu">
                            <ul class="layui-anim layui-anim-down">
                                {foreach name="$vo.child" item="son"}
                                <li lay-options="" lay-href="{$son.href}">
                                    <div class="layui-menu-body-title">{$son.title}</div>
                                </li>
                                {/foreach}
                            </ul>
                        </div>
                        <div class="child-menu-hide">
                            <div class="child-menu-title">
                                {$vo.title}
                            </div>
                            <ul class="layui-nav layui-nav-tree layui-menu  layui-anim layui-anim-downbit">
                                {foreach name="$vo.child" item="son"}
                                <li class="layui-menu-item-parent each-child" lay-href="{$son.href}"
                                    onclick="menuChecked($(this))">
                                    <div class="layui-menu-body-title faster-title"
                                         style="text-align: center;padding: initial">
                                        {$son.title}
                                    </div>
                                </li>
                                {/foreach}
                            </ul>
                        </div>
                        {/if}
                    </li>
                    {/foreach}
                </ul>
            </div>
            <div class="child-menu">
                <div class="child-menu-title">
                    {$menus.0.title}
                </div>
                <ul class="layui-nav layui-nav-tree layui-menu">
                    {foreach name="menus.0.child" item="son"}
                    <li class="layui-menu-item-parent child-menu-lk" lay-href="{$son.href}">
                        <div class="layui-menu-body-title faster-title">
                            {$son.title}
                        </div>
                    </li>
                    {/foreach}
                </ul>

                <!--                <div class="layui-side-scroll" style="width: 100%">-->
                <!--                    &lt;!&ndash; 左侧导航区域（可配合layui已有的垂直导航） &ndash;&gt;-->
                <!--                    <ul class="layui-nav layui-nav-tree" lay-filter="test">-->
                <!--                        <li class="layui-nav-item layui-nav-itemed">-->
                <!--                            <a class="" href="javascript:;" style="color: #000 !important;">会员管理</a>-->
                <!--                            <dl class="layui-nav-child">-->
                <!--                                <dd><a href="javascript:;">menu 1</a></dd>-->
                <!--                                <dd><a href="javascript:;">menu 2</a></dd>-->
                <!--                                <dd><a href="javascript:;">menu 3</a></dd>-->
                <!--                                <dd><a href="javascript:;">the links</a></dd>-->
                <!--                            </dl>-->
                <!--                        </li>-->
                <!--                        <li class="layui-nav-item">-->
                <!--                            <a href="javascript:;">menu group 2</a>-->
                <!--                            <dl class="layui-nav-child">-->
                <!--                                <dd><a href="javascript:;">list 1</a></dd>-->
                <!--                                <dd><a href="javascript:;">list 2</a></dd>-->
                <!--                                <dd><a href="javascript:;">超链接</a></dd>-->
                <!--                            </dl>-->
                <!--                        </li>-->
                <!--                        <li class="layui-nav-item"><a href="javascript:;">click menu item</a></li>-->
                <!--                        <li class="layui-nav-item"><a href="javascript:;">the links</a></li>-->
                <!--                    </ul>-->
                <!--                </div>-->

            </div>

        </div>
        <!-- 页面标签 -->
        <div class="layadmin-pagetabs" id="LAY_app_tabs">
            <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
            <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
            <div class="layui-icon layadmin-tabs-control layui-icon-down">
                <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
                    <li class="layui-nav-item" lay-unselect>
                        <a href="javascript:;"></a>
                        <dl class="layui-nav-child layui-anim-fadein">
                            <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
                            <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
                            <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
            <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
                <ul class="layui-tab-title" id="LAY_app_tabsheader">
                    <li lay-id="home/console.html" lay-attr="home/console.html" class="layui-this"><i
                            class="layui-icon layui-icon-home"></i></li>
                </ul>
            </div>
        </div>

        <!-- 主体内容 -->
        <div class="layui-body" id="LAY_app_body">
            <div class="layadmin-tabsbody-item layui-show">

                <iframe src="{:url('welcome')}" frameborder="0" class="layadmin-iframe"></iframe>
            </div>
        </div>

        <!-- 辅助元素，一般用于移动设备下遮罩 -->
        <div class="layadmin-body-shade" layadmin-event="shade"></div>
    </div>
</div>

{include file="public/footer" /}

</body>
<script>
    $(function () {
        var a = $;
        a(".switch-menu").click(function () {
            var a = $(this).children('.child-menu-hide').html(), b = $('.child-menu'), c = $("#LAY_app"),
                d = "layadmin-side-shrink", e = $(".eject-menu"), f = $(this).children('.eject-menu'),
                g = "hide-eject-menu", t;
            t = c.hasClass(d);
            b.html(a);
            t ? '' : f.hasClass(g) ? "" : f.addClass('hide-eject-menu');
            $(this).addClass('layui-menu-item-checked2').siblings().removeClass('layui-menu-item-checked2')
        });
    })

    function menuChecked(_this) {
        _this.addClass('layui-menu-item-checked').siblings().removeClass('layui-menu-item-checked')
    }
</script>
</html>


